package phapp.model.barapp;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;


/**
 * <p> 标题: 测试ＤＥＭＯ, tx_syte_demo_info 数据类 POJO
 * Description: DAO层映射到数据类,页面封装数据映射到数据类
 * Copyright: Copyright (c) 2014-10
 * Company: 
 * @author you name
 * @version 1.0
*/

public class SyteDemo extends BaseEntity {
   
   //date formats
   public static final String FORMAT_DATE_DEMO = DATE_TIME_FORMAT;
   public static final String FORMAT_DATETIME_DEMO = DATE_TIME_FORMAT;
   public static final String FORMAT_TIMESTAMP_DEMO = DATE_TIME_FORMAT;
   public static final String FORMAT_CREATE_TIME = DATE_TIME_FORMAT;
   
   //columns START
   /**序列*/
   private java.lang.Integer id;
   /**名称*/
   private java.lang.String name;
   /**操作员ID*/
   private java.lang.Integer userId;
   /**是否有效:10无效,20有效TINYINT*/
   private java.lang.Byte valid;
   /**int数字*/
   private java.lang.Integer number;
   /**URL地址*/
   private java.lang.String url;
   /**Email*/
   private java.lang.String email;
   /**变长字符集大对象*/
   private java.lang.String textDemo;
   /**变长二进制大对象*/
   private byte[] blobDemo;
   /**varchar示例*/
   private java.lang.String varcharDemo;
   /**日期示例*/
   private java.sql.Date dateDemo;
   /**DATETIME示例*/
   private java.sql.Timestamp datetimeDemo;
   /**TIMESTAMP示例*/
   private java.sql.Timestamp timestampDemo;
   /**FLOAT示例*/
   private java.lang.Float floatDemo;
   /**上级节点ID*/
   private java.lang.Integer parentId;
   /**创建时间*/
   private java.sql.Timestamp createTime;
   
   private java.util.ArrayList idList;
   //columns END

	public SyteDemo(){
	}

	public SyteDemo(
		java.lang.Integer id
	){
		this.id = id;
	}

   public void setId(java.lang.Integer value) {
      this.id = value;
   }
   
   public java.lang.Integer getId() {
      return this.id;
   }
   public void setName(java.lang.String value) {
      this.name = value;
   }
   
   public java.lang.String getName() {
      return this.name;
   }
   public void setUserId(java.lang.Integer value) {
      this.userId = value;
   }
   
   public java.lang.Integer getUserId() {
      return this.userId;
   }
   public void setValid(java.lang.Byte value) {
      this.valid = value;
   }
   
   public java.lang.Byte getValid() {
      return this.valid;
   }
   public void setNumber(java.lang.Integer value) {
      this.number = value;
   }
   
   public java.lang.Integer getNumber() {
      return this.number;
   }
   public void setUrl(java.lang.String value) {
      this.url = value;
   }
   
   public java.lang.String getUrl() {
      return this.url;
   }
   public void setEmail(java.lang.String value) {
      this.email = value;
   }
   
   public java.lang.String getEmail() {
      return this.email;
   }
   public void setTextDemo(java.lang.String value) {
      this.textDemo = value;
   }
   
   public java.lang.String getTextDemo() {
      return this.textDemo;
   }
   public void setBlobDemo(byte[] value) {
      this.blobDemo = value;
   }
   
   public byte[] getBlobDemo() {
      return this.blobDemo;
   }
   public void setVarcharDemo(java.lang.String value) {
      this.varcharDemo = value;
   }
   
   public java.lang.String getVarcharDemo() {
      return this.varcharDemo;
   }
   public String getDateDemoString() {
      return date2String(getDateDemo(), FORMAT_DATE_DEMO);
   }
   
   public void setDateDemoString(String value) {
      setDateDemo(string2Date(value, FORMAT_DATE_DEMO,java.sql.Date.class));
   }
   
   public void setDateDemo(java.sql.Date value) {
      this.dateDemo = value;
   }
   
   public java.sql.Date getDateDemo() {
      return this.dateDemo;
   }
   public String getDatetimeDemoString() {
      return date2String(getDatetimeDemo(), FORMAT_DATETIME_DEMO);
   }
   
   public void setDatetimeDemoString(String value) {
      setDatetimeDemo(string2Date(value, FORMAT_DATETIME_DEMO,java.sql.Timestamp.class));
   }
   
   public void setDatetimeDemo(java.sql.Timestamp value) {
      this.datetimeDemo = value;
   }
   
   public java.sql.Timestamp getDatetimeDemo() {
      return this.datetimeDemo;
   }
   public String getTimestampDemoString() {
      return date2String(getTimestampDemo(), FORMAT_TIMESTAMP_DEMO);
   }
   
   public void setTimestampDemoString(String value) {
      setTimestampDemo(string2Date(value, FORMAT_TIMESTAMP_DEMO,java.sql.Timestamp.class));
   }
   
   public void setTimestampDemo(java.sql.Timestamp value) {
      this.timestampDemo = value;
   }
   
   public java.sql.Timestamp getTimestampDemo() {
      return this.timestampDemo;
   }
   public void setFloatDemo(java.lang.Float value) {
      this.floatDemo = value;
   }
   
   public java.lang.Float getFloatDemo() {
      return this.floatDemo;
   }
   public void setParentId(java.lang.Integer value) {
      this.parentId = value;
   }
   
   public java.lang.Integer getParentId() {
      return this.parentId;
   }
   public String getCreateTimeString() {
      return date2String(getCreateTime(), FORMAT_CREATE_TIME);
   }
   
   public void setCreateTimeString(String value) {
      setCreateTime(string2Date(value, FORMAT_CREATE_TIME,java.sql.Timestamp.class));
   }
   
   public void setCreateTime(java.sql.Timestamp value) {
      this.createTime = value;
   }
   
   public java.sql.Timestamp getCreateTime() {
      return this.createTime;
   }

   public java.util.ArrayList getIdList() {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList) {
      this.idList = idList;
   }

    /**手动增加属性后,toString,hashCode,equals都要修改*/
   public String toString() {
      return new ToStringBuilder(this)
         .append("Id",getId())
         .append("Name",getName())
         .append("UserId",getUserId())
         .append("Valid",getValid())
         .append("Number",getNumber())
         .append("Url",getUrl())
         .append("Email",getEmail())
         .append("TextDemo",getTextDemo())
         .append("BlobDemo",getBlobDemo())
         .append("VarcharDemo",getVarcharDemo())
         .append("DateDemo",getDateDemo())
         .append("DatetimeDemo",getDatetimeDemo())
         .append("TimestampDemo",getTimestampDemo())
         .append("FloatDemo",getFloatDemo())
         .append("ParentId",getParentId())
         .append("CreateTime",getCreateTime())
         .toString();
   }
   
   public int hashCode() {
      return new HashCodeBuilder()
         .append(getId())
         .append(getName())
         .append(getUserId())
         .append(getValid())
         .append(getNumber())
         .append(getUrl())
         .append(getEmail())
         .append(getTextDemo())
         .append(getBlobDemo())
         .append(getVarcharDemo())
         .append(getDateDemo())
         .append(getDatetimeDemo())
         .append(getTimestampDemo())
         .append(getFloatDemo())
         .append(getParentId())
         .append(getCreateTime())
         .toHashCode();
   }
   
   public boolean equals(Object obj) {
      if(obj instanceof SyteDemo == false) return false;
      if(this == obj) return true;
      SyteDemo other = (SyteDemo)obj;
      return new EqualsBuilder()
         .append(getId(),other.getId())
         .append(getName(),other.getName())
         .append(getUserId(),other.getUserId())
         .append(getValid(),other.getValid())
         .append(getNumber(),other.getNumber())
         .append(getUrl(),other.getUrl())
         .append(getEmail(),other.getEmail())
         .append(getTextDemo(),other.getTextDemo())
         .append(getBlobDemo(),other.getBlobDemo())
         .append(getVarcharDemo(),other.getVarcharDemo())
         .append(getDateDemo(),other.getDateDemo())
         .append(getDatetimeDemo(),other.getDatetimeDemo())
         .append(getTimestampDemo(),other.getTimestampDemo())
         .append(getFloatDemo(),other.getFloatDemo())
         .append(getParentId(),other.getParentId())
         .append(getCreateTime(),other.getCreateTime())
         .isEquals();
   }
}

